var initionstate= {
    count: 0,
    lists:{
        rows:[],
        totle:0
    },
    news:{
        rows:[],
        totle:0
    }
}
function reducer(state =initionstate, action) {
    switch (action.type) {
        case "INCREASE":
            // return {
            //     count: state.count + 1
            // }
            // return  Object.assign({},state,{count:state.count+1})
        return {...state,count:state.count+1}

        case "DECREASE":
        // return{
        //     count1:state.count1-1
        // }
        // return  Object.assign({},state,{count1:state.count1-1});
        return {...state,count:state.count-1}

        case "GETLIST":
        // console.log(action);
        return  Object.assign({},state,{lists:action.payload});

        case "GETNEWS":
        // console.log(action);
        return  Object.assign({},state,{news:action.payload});
        default:
            return state;
    }
}
export default reducer;